# Contributor: Tuan Anh Tran <me@tuananh.org>
# Maintainer: Tuan Anh Tran <me@tuananh.org>
pkgname=prometheus-podman-exporter
pkgver=1.11.0
pkgrel=0
pkgdesc="Prometheus exporter for podman environments exposing containers, pods, images, volumes and networks information"
url="https://github.com/containers/prometheus-podman-exporter"
arch="all"
license="Apache-2.0"
makedepends="go bash device-mapper lvm2-dev gpgme-dev linux-headers btrfs-progs-dev"
options="!check" # tests require root privileges (clone, etc...)
source="$pkgname-$pkgver.tar.gz::https://github.com/containers/prometheus-podman-exporter/archive/refs/tags/v$pkgver.tar.gz
	basename.patch
	"

export GOFLAGS="$GOFLAGS -modcacherw"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	make binary
}

package() {
	install -Dm0755 bin/prometheus-podman-exporter -t "$pkgdir"/usr/bin/
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 -t "$pkgdir"/usr/share/doc/"$pkgname" README.md
}

sha512sums="
f976d77940c08202e629c27ba91810f1d9b03ee6b3ebbbcd1568491aec70eba2fae70e6e5ec261105bcd503e5508a95f75eb5a0e5e7916bcbb17205d8a17f7da  prometheus-podman-exporter-1.11.0.tar.gz
ee4cbe8e73e88f5a31d838dd9739f7c55d16020589e758f9c2198d37129bd58d1fef993e501fc911a5bca3ce9267b128a9d0ab91ecfa2cedbaee42baa7ea9e7a  basename.patch
"
